package org.savara.sam.client;

import com.google.gwt.event.dom.client.ClickEvent;
import com.google.gwt.event.dom.client.ClickHandler;
import com.google.gwt.gadgets.client.Gadget;
import com.google.gwt.user.client.Window;
import com.google.gwt.user.client.ui.Button;
import com.google.gwt.user.client.ui.RootPanel;

@Gadget.ModulePrefs(title = "sam gadget", author = "Jeff Yu")
@Gadget.UseLongManifestName(false)
@Gadget.AllowHtmlQuirksMode(false)
public class SamGadget extends Gadget<SamPreferences> {

    @Override
    protected void init(SamPreferences userPreferences) {

        Button simpleBtn = new Button("SAM Gadget");
        simpleBtn.addClickHandler(new ClickHandler() {
            public void onClick(ClickEvent clickEvent) {
                Window.alert("Hello SAM!");
            }
        });
        RootPanel.get().add(simpleBtn);
    }
}
